import Vue from 'vue';
import {
	setLocalStorage,
	getLocalStorage,
	parseQueryString
} from './index';
//页面初始化执行的函数
let pageOnShow = async function() {


	let routes =window.location.href; // 获取当前打开过的页面路由数组
	let notLogin = ['pages/login/login','pages/index/index','pages/login/register'];
	let res = false;
	for(var i=0;i<notLogin.length;i++){
		res = routes.search(notLogin[i])==-1?false:true;
		if(res){
			break;
			
		}
	}
	if(!res){
		let manage_id = localStorage.getItem('manager_id');
		if ((!manage_id) && !res) {
			uni.navigateTo({
				url: `/pages/login/login`
			});
		}
	}
	
};



module.exports = {
	pageOnShow
};
